//
//  P5587.cpp
//  Algorithm
//
//  Created by 刘锦程 on 2023/9/21.
//

#include <stdio.h>
#include<iostream>
#include<math.h>
using namespace std;

string s[10005];
int input(){
    int i=0;
    char ch;
    int point=0;
    while(s[i-1]!="EOF"){
        while((ch=getchar())!=EOF){
            if(s[i]=="EOF"){
                break;
            }
            if(ch=='\n') break;
            if(point==0&&ch=='<') continue;
            if(ch=='<') {
                point--;
                s[i].erase(point,1);
                continue;
            }
            s[i]+=ch;
            point++;
        }
        if(s[i]=="EOF"){
            break;
        }
        i++;
    }
    return i;
}
int P5587ans(){
    double ans=0;
    int n=input();
    for(int i=0;i<=n;i++){
        if(s[i].empty()){continue;}
        string pattern="";
        char ch;
        int point=0;
        while((ch=getchar())!=EOF){
            if(pattern=="EOF"){
                ans-=3;
               // getchar();
                break;
            }
            if(ch=='\n'){
                break;
            }
            if(point==0&&ch=='<') continue;
            if(ch=='<') {
                point--;
                pattern.erase(point,1);
                continue;
            }
            pattern+=ch;
            if(ch==s[i][point]) ans++;
            point++;
        }
       // if(pattern==s[i]) ans+=s[i].length();
        if(pattern=="EOF") break;
    }
    double Tim=0;
    scanf("%lf",&Tim);
    Tim=Tim/60.0;
    cout<<(int)(ans/Tim+0.5)<<endl;
    return 0;
}
